Copyright: Copyright 1995 StarTech Computer Services


noTMailBox HelpTRUEMAILBOXyesyes29/06/95


Table of Contents

Using the Tmailbox Component

The CreateMailbox Method

The AddMail Method

The LoadMail Method

The DeleteMail Method

The TransferTo method

The Compress Method

The EmptyTrash Method

The MailboxDirectory property

The MailBoxes Property

The CurrentMailBoxName Property

The CurrentMailboxNumber

The CurrentMailboxMessages Property

The CurrentMailboxSize Property

The CurrentMailboxTrash property

The Msg_Text Property

The Msg_From property

The Msg_Date property

The Msg_To Property

The Msg_Subject Property

The Msg_Lines Property

The Msg_Size Property

The Msg_Number Property

The Msg_Part Property

The Msg_Flag Property


Help file produced by  HELLLP! v2.4b , a product of Guy Software, on 6/29/95 for Unregistered User.

The above table of contents will be automatically completed and will also provide an excellent cross-reference for context strings and topic titles.  You may leave it as your main table of contents for your help file, or you may create your own and cause it to be displayed instead by using the I button on the toolbar.  This page will not be displayed as a topic.  It is given a context string of _._ and a HelpContextID property of 32517, but these are not presented for jump selection.

HINT:  If you do not wish some of your topics to appear in the table of contents as displayed to your users (you may want them ONLY as PopUps), move the lines with their titles and contexts to below this point.  If you do this remember to move the whole line, not part.  As an alternative, you may wish to set up your own table of contents, see Help under The Structure of a Help File.

  Do not delete any codes in the area above the Table of Contents title, they are used internally by HELLLP!

properties

methods


Using the TMailbox Component

properties	methods

 The StarTech TMailbox component facilitates the task of retrieving and organizing electronic mail by providing storage for messages. To create a mailbox system or to open an existing mailbox system, set the MailboxDirectory property. A mailbox system consists of at least three mailboxes, In, Out and Trash. Additional mailboxes can be created using the CreateMailBox method. The list of mailboxes in the system is stored in MailBoxes.

Before working with a mailbox, it should be selected using the CurrentMailboxNumber or CurrentMailBoxName property. The CurrentMailboxMessages property gives the count of messages in the currently selected mailbox. The CurrentMailboxSize and CurrentMailboxTrash properties give the size of the mailbox and size of the trash area in bytes of the current mailbox.

To add a message to a mailbox, set the Msg_Text, Msg_From,Msg_To, Msg_Date,Msg_part and Msg_Subject property and call the AddMail method. To retrieve a message from a mailbox, set the Msg_Number property to the desired message number and call the LoadMail method. The message will be retrieved and stored in the Msg_Text property. The Msg_From, Msg_To, Msg_Date,Msg_Subject,Msg Size, Msg_part,Msg_Lines and Msg_Flag will contain the messages sender, recipient, date, subject, size in bytes, part, number of lines and flag respectively.

A message can be deleted using the DeleteMail method. A message can also be transferred to another mailbox using the TransferTo method.

The Compress method compresses the current mailbox after messages have been deleted. The EmptyTrash method clears the Trash mailbox of all messages.


The CreateMailbox Method

Applies to:

TMailbox

Declaration:

procedure CreateMailBox(name: string);

Description:

The CreateMailbox method creates a mailbox with the name given in the name parameter. The mailbox name should be one to eight characters long and should be comprised of only alphanumeric characters. This call will fail if name is invalid or a mailbox name already exists


The AddMail Method

Applies to:

TMailbox

Declaration:

procedure AddMail;

Description:

The AddMail Method adds the message stored in Msg_Text to the current mailbox. The Msg_Subject, Msg_Date, Msg_From , Msg_To and Msg_part property should also be set prior to calling the AddMail method.

See Also:

Msg_Text property

Msg_Subject property

Msg_Date property

Msg_From property

Msg_To property

Msg_Part property


The LoadMail Method

Applies to:

TMailbox

Declaration:

procedure LoadMail;

Description:

The LoadMail method loads the message specified in Msg_Number into the Msg_Text property.

See Also:

Msg_Number property


The DeleteMail Method

Applies to:

TMailbox

Declaration:

procedure DeleteMail;

Description:

The DeleteMail method deletes the message specified in Msg_Number from the current mailbox. When a message is deleted, the entry for the message is removed from the index file, but the message body still takes up space in the mailbox file, until the Compress method is called

See Also:

Msg_Number property

Compress Method


The TransferTo method

Applies to:

TMailbox

Declaration:

procedure TransferTo(name: string);

Description:

The TransferTo method transfer the message specified in Msg_Number to the mailbox specified in the name parameter. When a message is transferred, the entry for the message is removed from the index file, but the message body still takes up space in the mailbox file, until the Compress method is called

See Also:

Msg_Number property

Compress Method


The Compress Method

Applies to:

TMailbox

Declaration:

procedure Compress;

Description:

When a message is deleted or transferred, the entry for the message is removed from the index file, but the message body still takes up space in the mailbox file, until the Compress method is called. The Compress method rebuilds the mailbox file for the mailbox specified in CurrentMailboxName or CurrentMailboxNumber.

See Also:

CurrentMailboxName property

CurrentMailboxNumber property


The EmptyTrash Method

Applies to:

TMailbox

Declaration:

procedure EmptyTrash;

Description:

The EmptyTrash procedure empties the Trash mailbox. This procedure is provided for implementations where message is deletion is accomplished by transferring the message to the Trash mailbox.


The MailboxDirectory property

Applies to:

TMailbox

Declaration:

property MailboxDirectory: string;

Description:

The Mailbox directory specifies the location of the mailbox system. This is the first property that should be set. If a mailbox system is not found in the specified directory, a default mailbox system is created. A default mailbox system consists of an In, Out and Trash  mailbox.

Setting the MailboxDirectory property updates the Mailboxes property and sets the current mailbox to the In mailbox.

See Also:

Mailboxes property


The MailBoxes Property

Applies to:

TMailbox

Declaration:

property Mailboxes: TStrings;

Description:

The Mailboxes property contains the list of mailboxes contained in the mailbox system.


The CurrentMailBoxName Property

Applies to:

TMailbox

Declaration:

property CurrentMailboxName: string;

Description:

The CurrentMailboxName property contains the name of the current mailbox. Setting the CurrentMailboxName property to a valid mailbox name will change the current mailbox and update the CurrentMailboxNumber property. Mailbox names are not case sensitive. When the current mailbox is changed, the CurrentMailboxMessages, CurrentMailboxSize and CurrentMailboxTrash properties are updated.

See Also:

CurrentMailboxNumber property

CurrentMailboxMessages property

CurrentMailboxSize property

CurrentMailboxTrash property


The CurrentMailboxNumber
The CurrentMailboxNumber Property

Applies to:

TMailbox

Declaration:

property CurrentMailboxNumber: string;

Description:

The CurrentMailboxNumber property contains the number of the current mailbox. Setting the CurrentMailboxNumber property to a valid mailbox name will change the current mailbox and update the CurrentMailboxName property. Mailboxes are numbered starting with one. When the current mailbox is changed, the CurrentMailboxMessages, CurrentMailboxSize and CurrentMailboxTrash properties are updated.

See Also:

CurrentMailboxName property

CurrentMailboxMessages property

CurrentMailboxSize property

CurrentMailboxTrash property


The CurrentMailboxMessages Property

Applies to:

TMailbox

Declaration:

property CurrentMailboxMessages:integer

Description:

The CurrentMailboxMessages property contains the number of messages in the current mailbox. This property is automatically updated when the CurrentMailboxName or CurrentMailboxNumber is changed, or after a call to the AddMail, DeleteMail or TransferTo method.

See Also:

CurrentMailboxName property

CurrentMailboxNumber property


The CurrentMailboxSize Property

Applies to:

TMailbox

Declaration:

property CurrentMailboxSize:Longint;

Description:

The CurrentMailboxSize property contains the size of  the current mailbox in bytes  This property is automatically updated when the CurrentMailboxName or CurrentMailboxNumber is changed, or after a call to the AddMail or Compress method. Note that a call to the DeleteMail or TransferTo method does not change the size of the mailbox.

See Also:

Compress Method

CurrentMailboxName property

CurrentMailboxNumber property


The CurrentMailboxTrash property

Applies to:

TMailbox

Declaration:

property CurrentMailboxTrash:Longint;

Description:

The CurrentMailboxTrash property contains the size of  the current mailbox trash in bytes  This property is automatically updated when the CurrentMailboxName or CurrentMailboxNumber is changed, or after a call to the DeleteMail, TransferTo or Compress method. The Compress method eliminates all the trash from the current mailbox.

See Also:

Compress Method

CurrentMailboxName property

CurrentMailboxNumber property


The Msg_Text Property

Applies to:

TMailbox

Declaration:

property Msg_Text: TStrings;

Description:

The Msg_Text property contains the text of a message following a call to the LoadMail method. The Msg_Text property should also be set prior to calling the AddMail method.


The Msg_From property

Applies to:

TMailbox

Declaration:

property Msg_From: string;

Description:

The Msg_From property contains the sender of a message. The Msg_From property is updated after the Msg_Number property is set. This property should also be set prior to calling the AddMail method.

See Also:

Msg_Number property

AddMail method


The Msg_Date property

Applies to:

TMailbox

Declaration:

property Msg_Date: string;

Description:

The Msg_Date property contains the date of a message. The Msg_Date property is updated after the Msg_Number property is set. This property should also be set prior to calling the AddMail method.

See Also:

Msg_Number property

AddMail method


The Msg_To Property

Applies to:

TMailbox

Declaration:

property Msg_To: string;

Description:

The Msg_To property contains the recipient of a message. The Msg_To property is updated after the Msg_Number property is set. This property should also be set prior to calling the AddMail method.

See Also:

Msg_Number property

AddMail method


The Msg_Subject Property

Applies to:

TMailbox

Declaration:

property Msg_Subject: string;

Description:

The Msg_Subject property contains the subject of a message. The Msg_Subject property is updated after the Msg_Number property is set. This property should also be set prior to calling the AddMail method.

See Also:

Msg_Number property

AddMail method


The Msg_Lines Property

Applies to:

TMailbox

Declaration:

property Msg_Lines: Longint;

Description:

The Msg_Lines property contains the number of lines in the current message. The Msg_Lines property is updated after the Msg_Number property is set.

See Also:

Msg_Number property


The Msg_Size Property

Applies to:

TMailbox

Declaration:

property Msg_Size: Longint;

Description:

The Msg_Size property contains the size of  the current message. The Msg_Size property is updated after the Msg_Number property is set.

See Also:

Msg_Number property


The Msg_Number Property

Applies to:

TMailbox

Declaration:

property Msg_Size: Longint;

Description:

The Msg_Size property contains the number of  the current message. When the Msg_Number property is set, the Msg_From, Msg_To, Msg_Subject, Msg_Date, Msg_Lines, Msg_Size, Msg_Flag and Msg_Part properties are updated. Note that the message text is not loaded in Msg_Text until the LoadMail method is called.

See Also:

Msg_Subject property

Msg_Date property

Msg_From property

Msg_To property

Msg_Part property

Msg_Lines property

Msg_Size property

Msg_Flag property


The Msg_Part Property

Applies to:

TMailbox

Declaration:

property Msg_Part: integer;

Description:

The Msg_Part property contains the part of a message, for large messages over 64K that have to be split up in several parts. The Msg_Part property is updated after the Msg_Number property is set. This property should also be set prior to calling the AddMail method.

See Also:

Msg_Number property

AddMail method


The Msg_Flag Property

Applies to:

TMailbox

Declaration:

property Msg_Flag: Char;

Description:

The Msg_Flag property contains the flag for the current message. The Msg_Flag property is updated after the Msg_Number property is set. This property is automatically set to U (for unread)  during the AddMail method. Setting the Msg_Flag property will update the flag for the current message.

See Also:

Msg_Number property

AddMail method


properties

CurrentMailboxMessages

CurrentMailBoxName

CurrentMailboxNumber

CurrentMailboxSize

CurrentMailboxTrash

MailboxDirectory

MailBoxes

Msg_Date

Msg_Flag

Msg_From

Msg_Lines

Msg_Number

Msg_Part

Msg_Size

Msg_Subject

Msg_Text

Msg_To


methods

CreateMailbox

AddMail

LoadMail

DeleteMail

TransferTo

Compress

EmptyTrash